﻿using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Linq;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;
using WfActivityLibrary.control;

namespace WfActivityLibrary
{
    public partial class 等待审批提交 : System.Workflow.Activities.HandleExternalEventActivity
    {
        public 等待审批提交()
        {
            InitializeComponent();
        }
        private void 等待_Invoked(object sender, ExternalDataEventArgs e)
        {
            WaitArgs args = e as WaitArgs;
            ChoiceClrxx clrxxEntity = null;
            if (args != null)
            {
                this.返回结果 = args.exResult;
                if (args.otherInfo != null && args.otherInfo is ChoiceClrxx)
                {
                    clrxxEntity = (ChoiceClrxx)args.otherInfo;
                }

                Activity temp = this;
                while (temp.Parent != null)
                {
                    temp = temp.Parent;
                }
                if (temp != null && temp is BaseStateWorkflow)
                {
                    (temp as BaseStateWorkflow).提交结果 = this.返回结果;
                    (temp as BaseStateWorkflow).下一步处理人 = clrxxEntity;
                }
                else if (temp != null && temp is BaseSequenceWorkflow)
                {
                    (temp as BaseSequenceWorkflow).提交结果 = this.返回结果;
                    (temp as BaseSequenceWorkflow).下一步处理人 = clrxxEntity;
                }


            }
        }

        public static DependencyProperty 返回结果Property =
            DependencyProperty.Register("返回结果", typeof(string), typeof(等待审批提交));

        [DescriptionAttribute("返回结果")]
        [CategoryAttribute("参数")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 返回结果
        {
            get
            {
                return ((string)(base.GetValue(等待审批提交.返回结果Property)));
            }
            set
            {
                base.SetValue(等待审批提交.返回结果Property, value);
            }
        }
    }
}
